package com.zzptc.sky.bdsjws.activites;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.zzptc.sky.bdsjws.activites.base.BaseActivity;
import com.zzptc.sky.bdsjws.com.MySharedPreferences;
import com.zzptc.sky.bdsjws.utils.MyUtil;

import java.lang.reflect.GenericArrayType;

public class LoginActivity extends AppCompatActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //共享首选项判断
        //判断 用户是否为第一次进入  共享首选项
        SharedPreferences sharedPreferences= MyUtil.getSharedPre();
//        SharedPreferences.Editor editor=sharedPreferencess.edit();
//        editor.putBoolean("flag",false);
//        editor.commit();
//        SharedPreferences sharedPreferences= MySharedPreferences.getSharedPreferences();
        boolean bool=sharedPreferences.getBoolean("flag",false);
        System.out.println(bool);
        if(bool){
            //进入欢迎页面
            Intent intent=new Intent(this,WelcomeActivity.class);
            startActivity(intent);
        }else{
            //进入引导页面
            startActivity(new Intent(this,GuideActivity.class));
        }
//        System.out.println(bool);
        finish();
    }

}
